#coding = utf-8
#12.21 解析 ga1400 json信息 ，显示字段的中文表示信息
import json

nonMotorVehicleObject = { 
    "NonMotorVehicleID":"车辆标识", 
    "InfoKind":"信息分类", 
    "SourceID":"来源标识", 
    "DeviceID":"设备编码", 
    "LeftTopX":"左上角X坐标", 
    "LeftTopY":"左上角Y坐标", 
    "RightBtmX":"右下角X坐标", 
    "RightBtmY":"右下角Y坐标", 
    "MarkTime":"位置标记时间", 
    "AppearTime":"车辆出现时间", 
    "DisappearTime":"车辆消失时间", 
    "HasPlate":"有无车牌", 
    "PlateClass":"号牌种类", 
    "PlateColor":"车牌颜色", 
    "PlateNo":"车牌号", 
    "PlateNoAttach":"挂车牌号", 
    "PlateDescribe":"车牌描述", 
    "IsDecked":"是否套牌", 
    "IsAltered":"是否涂改", 
    "IsCovered":"是否遮挡", 
    "Speed":"行驶速度", 
    "DrivingStatusCode":"行驶状态代码", 
    "UsingPropertiesCode":"车辆使用性质代码", 
    "VehicleBrand":"车辆品牌", 
    "VehicleType":"车辆款型", 
    "VehicleLength":"车辆长度", 
    "VehicleWidth":"车辆宽度", 
    "VehicleHeight":"车辆高度", 
    "VehicleColor":"车身颜色", 
    "VehicleHood":"车前盖", 
    "VehicleTrunk":"车后盖", 
    "VehicleWheel":"车轮", 
    "WheelPrintedPattern":"车轮印花纹", 
    "VehicleWindow":"车窗", 
    "VehicleRoof":"车顶", 
    "VehicleDoor":"车门", 
    "SideOfVehicle":"车侧", 
    "CarOfVehicle":"车厢", 
    "RearviewMirror":"后视镜", 
    "VehicleChassis":"底盘", 
    "VehicleShielding":"遮挡", 
    "FilmColor":"贴膜颜色", 
    "IsModified":"改装标志", 
    "SubImageList":"图像列表"
}
motorVehicleObject = {
    "MotorVehicleID":"车辆标识", 
    "InfoKind":"信息分类", 
    "SourceID":"来源标识", 
    "TollgateID":"关联卡口编号", 
    "DeviceID":"设备编码", 
    "StorageUrl1":"近景照片", 
    "StorageUrl2":"车牌照片", 
    "StorageUrl3":"远景照片", 
    "StorageUrl4":"合成图", 
    "StorageUrl5":"缩略图", 
    "LeftTopX":"左上角X坐标", 
    "LeftTopY":"左上角Y坐标", 
    "RightBtmX":"右下角X坐标", 
    "RightBtmY":"右下角Y坐标", 
    "MarkTime":"位置标记时间", 
    "AppearTime":"车辆出现时间", 
    "DisappearTime":"车辆消失时间", 
    "LaneNo":"车道号", 
    "HasPlate":"有无车牌", 
    "PlateClass":"号牌种类", 
    "PlateColor":"车牌颜色", 
    "PlateNo":"车牌号", 
    "PlateNoAttach":"挂车牌号", 
    "PlateDescribe":"车牌描述", 
    "IsDecked":"是否套牌", 
    "IsAltered":"是否涂改", 
    "IsCovered":"是否遮挡", 
    "Speed":"行驶速度", 
    "Direction":"行驶方向", 
    "DrivingStatusCode":"行驶状态代码", 
    "UsingPropertiesCode":"车辆使用性质代码", 
    "VehicleClass":"车辆类型", 
    "VehicleBrand":"车辆品牌", 
    "VehicleModel":"车辆型号", 
    "VehicleStyles":"车辆年款", 
    "VehicleLength":"车辆长度", 
    "VehicleWidth":"车辆宽度", 
    "VehicleHeight":"车辆高度", 
    "VehicleColor":"车身颜色", 
    "VehicleColorDepth":"颜色深浅", 
    "VehicleHood":"车前盖", 
    "VehicleTrunk":"车后盖", 
    "VehicleWheel":"车轮", 
    "WheelPrintedPattern":"车轮印花纹", 
    "VehicleWindow":"车窗", 
    "VehicleRoof":"车顶", 
    "VehicleDoor":"车门", 
    "SideOfVehicle":"车侧", 
    "CarOfVehicle":"车厢", 
    "RearviewMirror":"后视镜", 
    "VehicleChassis":"底盘", 
    "VehicleShielding":"遮挡", 
    "FilmColor":"贴膜颜色", 
    "IsModified":"改装标志", 
    "HitMarkInfo":"撞痕信息", 
    "VehicleBodyDesc":"车身描述", 
    "VehicleFrontItem":"车前部物品", 
    "DescOfFrontItem":"车前部物品描述", 
    "VehicleRearItem":"车后部物品", 
    "DescOfRearItem":"车后部物品描述", 
    "NumOfPassenger":"车内人数", 
    "PassTime":"经过时刻", 
    "NameOfPassedRoad":"经过道路名称", 
    "IsSuspicious":"是否可疑车", 
    "Sunvisor":"遮阳板状态", 
    "SafetyBelt":"安全带状态", 
    "Calling":"打电话状态", 
    "PlateReliability":"号牌识别可信度", 
    "PlateCharReliability":"每位号牌号码可信度", 
    "BrandReliability":"品牌标志识别可信度", 
    "SubImageList":"图像列表"
} 
faceObject = {
    "FaceID":"人脸标识", 
    "InfoKind":"信息分类", 
    "SourceID":"来源标识", 
    "DeviceID":"设备编码", 
    "LeftTopX":"左上角X坐标", 
    "LeftTopY":"左上角Y坐标", 
    "RightBtmX":"右下角X坐标", 
    "RightBtmY":"右下角Y坐标", 
    "LocationMarkTime":"位置标记时间", 
    "FaceAppearTime":"人脸出现时间", 
    "FaceDisAppearTime":"人脸消失时间", 
    "IDType":"证件种类", 
    "IDNumber":"证件号码", 
    "Name":"姓名", 
    "UsedName":"曾用名", 
    "Alias":"绰号", 
    "GenderCode":"性别代码", 
    "AgeUpLimit":"年龄上限", 
    "AgeLowerLimit":"年龄下限", 
    "EthicCode":"民族代码", 
    "NationalityCode":"国籍代码", 
    "NativeCityCode":"籍贯省市县代码", 
    "ResidenceAdminDivision":"居住地行政区划", 
    "ChineseAccentCode":"汉语口音代码", 
    "JobCategory":"职业类别代码", 
    "AccompanyNumber":"同行人脸数", 
    "SkinColor":"肤色", 
    "HairStyle":"发型", 
    "HairColor":"发色", 
    "FaceStyle":"脸型", 
    "FacialFeature":"脸部特征", 
    "PhysicalFeature":"体貌特征", 
    "RespiratorColor":"口罩颜色", 
    "CapStyle":"帽子款式", 
    "CapColor":"帽子颜色", 
    "GlassStyle":"眼镜款式", 
    "GlassColor":"眼镜颜色", 
    "IsDriver":"是否驾驶员", 
    "IsForeigner":"是否涉外人员", 
    "PassportType":"护照证件种类", 
    "ImmigrantTypeCode":"出入境人员类别代码", 
    "IsSuspectedTerrorist":"是否涉恐人员", 
    "SuspectedTerroristNumber":"涉恐人员编号", 
    "IsCriminalInvolved":"是否涉案人员", 
    "CriminalInvolvedSpecilisationCode":"涉案人员专长代码", 
    "BodySpeciallMark":"体表特殊标记", 
    "CrimeMethod":"作案手段", 
    "CrimeCharacterCode":"作案特点代码", 
    "EscapedCriminalNumber":"在逃人员编号", 
    "IsDetainees":"是否在押人员", 
    "DetentionHouseCode":"看守所编码", 
    "DetaineesIdentity":"在押人员身份", 
    "DetaineesSpecialIdentity":"在押人员特殊身份", 
    "MemberTypeCode":"成员类型代码", 
    "IsVictim":"是否被害人", 
    "VictimType":"被害人种类", 
    "InjuredDegree":"受伤害程度", 
    "CorpseConditionCode":"尸体状况代码", 
    "IsSuspiciousPerson":"是否可疑人", 
    "Attitude":"姿态分布", 
    "Similaritydegree":"相似度", 
    "EyebrowStyle":"眉型", 
    "NoseStyle":"鼻型", 
    "MustacheStyle":"胡型", 
    "LipStyle":"嘴唇", 
    "WrinklePouch":"皱纹眼袋", 
    "AcneStain":"痤疮色斑", 
    "FreckleBirthmark":"黑痣胎记", 
    "ScarDimple":"疤痕酒窝", 
    "OtherFeature":"其他特征", 
    "SubImageList":"图像列表"
} 
personObject = {
    "PersonID":"人员标识", 
    "InfoKind":"信息分类", 
    "SourceID":"来源标识", 
    "DeviceID":"设备编码", 
    "LeftTopX":"左上角X坐标", 
    "LeftTopY":"左上角Y坐标", 
    "RightBtmX":"右下角X坐标", 
    "RightBtmY":"右下角Y坐标", 
    "LocationMarkTime":"位置标记时间", 
    "PersonAppearTime":"人员出现时间", 
    "PersonDisAppearTime":"人员消失时间", 
    "IDType":"证件种类", 
    "IDNumber":"证件号码", 
    "Name":"姓名", 
    "UsedName":"曾用名", 
    "Alias":"绰号", 
    "GenderCode":"性别代码", 
    "AgeUpLimit":"年龄上限", 
    "AgeLowerLimit":"年龄下限", 
    "EthicCode":"民族代码", 
    "NationalityCode":"国籍代码", 
    "NativeCityCode":"籍贯省市县代码", 
    "ResidenceAdminDivision":"居住地行政区划", 
    "ChineseAccentCode":"汉语口音代码", 
    "PersonOrg":"单位名称", 
    "JobCategory":"职业类别代码", 
    "AccompanyNumber":"同行人数", 
    "HeightUpLimit":"身高上限", 
    "HeightLowerLimit":"身高下限", 
    "BodyType":"体型", 
    "SkinColor":"肤色", 
    "HairStyle":"发型", 
    "HairColor":"发色", 
    "Gesture":"姿态", 
    "Status":"状态", 
    "FaceStyle":"脸型", 
    "FacialFeature":"脸部特征", 
    "PhysicalFeature":"体貌特征", 
    "BodyFeature":"体表特征", 
    "HabitualMovement":"习惯动作", 
    "Behavior":"行为", 
    "BehaviorDescription":"行为描述", 
    "Appendant":"附属物", 
    "AppendantDescription":"附属物描述", 
    "UmbrellaColor":"伞颜色", 
    "RespiratorColor":"口罩颜色", 
    "CapStyle":"帽子款式", 
    "CapColor":"帽子颜色", 
    "GlassStyle":"眼镜款式", 
    "GlassColor":"眼镜颜色", 
    "ScarfColor":"围巾颜色", 
    "BagStyle":"包款式", 
    "BagColor":"包颜色", 
    "CoatStyle":"上衣款式", 
    "CoatLength":"上衣长度", 
    "CoatColor":"上衣颜色", 
    "TrousersStyle":"裤子款式", 
    "TrousersColor":"裤子颜色", 
    "TrousersLen":"裤子长度", 
    "ShoesStyle":"鞋子款式", 
    "ShoesColor":"鞋子颜色", 
    "IsDriver":"是否驾驶员", 
    "IsForeigner":"是否涉外人员", 
    "PassportType":"护照证件种类", 
    "ImmigrantTypeCode":"出入境人员类别代码", 
    "IsSuspectedTerrorist":"是否涉恐人员", 
    "SuspectedTerroristNumber":"涉恐人员编号", 
    "IsCriminalInvolved":"是否涉案人员", 
    "CriminalInvolvedSpecilisationCode":"涉案人员专长代码", 
    "BodySpeciallMark":"体表特殊标记", 
    "CrimeMethod":"作案手段", 
    "CrimeCharacterCode":"作案特点代码", 
    "EscapedCriminalNumber":"在逃人员编号", 
    "IsDetainees":"是否在押人员", 
    "DetentionHouseCode":"看守所编码", 
    "DetaineesIdentity":"在押人员身份", 
    "DetaineesSpecialIdentity":"在押人员特殊身份", 
    "MemberTypeCode":"成员类型代码", 
    "IsVictim":"是否被害人", 
    "VictimType":"被害人种类", 
    "InjuredDegree":"受伤害程度", 
    "CorpseConditionCode":"尸体状况代码", 
    "IsSuspiciousPerson":"是否可疑人", 
    "SubImageList":"图像列表"
}

imageInfo={
    "ImageID":"图像标识",
    "InfoKind":"信息分类",
    "ImageSource":"图像来源",
    "SourceVideoID":"来源视频标识",
    "OriginImageID":"原始图像标识",
    "EventSort":"事件分类",
    "DeviceID":"设备编码",
    "StoragePath":"存储路径",
    "FileHash":"图像文件哈希值",
    "FileFormat":"图像文件格式",
    "ShotTime":"拍摄时间",
    "Title":"题名",
    "TitleNote":"题名补充",
    "SpecialIName":"专项名",
    "Keyword":"关键词",
    "ContentDescription":"内容描述",
    "SubjectCharacter":"主题人物",
    "ShotPlaceCode":"拍摄地点行政区划代码",
    "ShotPlaceFullAdress":"拍摄地点区划内详细地址",
    "ShotPlaceLongitude":"拍摄地点经度",
    "ShotPlaceLatitude":"拍摄地点纬度",
    "HorizontalShotDirection":"水平拍摄方向",
    "VerticalShotDirection":"垂直拍摄方向",
    "SecurityLevel":"密级代码",
    "Width":"宽度",
    "Height":"高度",
    "CameraManufacturer":"照相机制造商",
    "CameraVersion":"照相机型号",
    "ApertureValue":"光圈值",
    "ISOSensitivity":"ISO感光值",
    "FocalLength":"焦距",
    "QualityGrade":"质量等级",
    "CollectorName":"采集人",
    "CollectorOrg":"采集单位名称",
    "CollectorIDType":"采集人证件类型",
    "CollectorID":"采集人证件号码",
    "EntryClerk":"入库人",
    "EntryClerkOrg":"入库单位名称",
    "EntryClerkIDType":"入库人证件类型",
    "EntryClerkID":"入库人证件号码",
    "EntryTime":"入库时间",
    "ImageProcFlag":"图像处理标志",
    "FileSize":"文件大小",
}

fileInfo={
    "FileID":"标识符",
    "InfoKind":"信息分类",
    "Source":"来源",
    "FileName":"文件名",
    "StoragePath":"存储路径",
    "FileHash":"文件哈希值",
    "FileFormat":"文件格式",
    "Title":"题名",
    "SecurityLevel":"密级代码",
    "SubmiterName":"入库人",
    "SubmiterOrg":"入库人单位",
    "EntryTime":"入库时间",
    "FileSize":"文件大小",
}

videoSliceInfo={
    "VideoID":"视频标识",
    "InfoKind":"信息分类",
    "VideoSource":"视频来源",
    "IsAbstractVideo":"摘要视频标志",
    "OriginVideoID":"原始视频ID",
    "OriginVideoURL":"原始视频URL",
    "EventSort":"事件分类",
    "DeviceID":"设备编码",
    "StoragePath":"存储路径",
    "ThumbnailStoragePath":"缩略图存储路径",
    "FileHash":"视频文件哈希值",
    "FileFormat":"视频文件格式",
    "CodedFormat":"视频编码格式",
    "AudioFlag":"音频标志",
    "AudioCodedFormat":"音频编码格式",
    "Title":"题名",
    "TitleNote":"题名补充",
    "SpecialName":"专项名",
    "Keyword":"关键词",
    "ContentDescription":"内容描述",
    "MainCharacter":"主题人物",
    "ShotPlaceCode":"拍摄地点行政区划代码",
    "ShotPlaceFullAdress":"拍摄地点区划内详细地址",
    "ShotPlaceLongitude":"拍摄地点经度",
    "ShotPlacetLatitude":"拍摄地点纬度",
    "HorizontalShotDirection":"水平拍摄方向",
    "VerticalShotDirection":"垂直拍摄方向",
    "SecurityLevel":"密级代码",
    "VideoLen":"视频长度",
    "BeginTime":"视频开始时间",
    "EndTime":"视频结束时间",
    "TimeErr":"时间误差",
    "Width":"宽度",
    "Height":"高度",
    "QualityGrade":"质量等级",
    "CollectorName":"采集人",
    "CollectorOrg":"采集单位名称",
    "CollectorIDType":"采集人证件类型",
    "CollectorID":"采集人证件号码",
    "EntryClerk":"入库人",
    "EntryClerkOrg":"入库单位名称",
    "EntryClerkIDType":"入库人证件类型",
    "EntryClerkID":"入库人证件号码",
    "EntryTime":"入库时间",
    "VideoProcFlag":"视频处理标志",
    "FileSize":"文件大小",
}

def parse_objs(xxxListObject, text=''):
    objmsg = ''
    if xxxListObject:
        for xxxobj in ['FaceObject','PersonObject','MotorVehicleObject','NonMotorVehicleObject']:
            obj = xxxListObject.get(xxxobj)
            if isinstance(obj, list): 
                if len(obj) == 0:
                    objmsg += '  '+text+'->' + xxxobj + '\n'
                    objmsg += ' -> {}\n'.format(obj)
                else:
                    for x in obj:
                        #print(x.keys())
                        objmsg += '  '+text+'->' + xxxobj + '\n'
                        for k,v in x.items():
                            if xxxobj == 'FaceObject':
                                msginfo = faceObject.get(k)
                            elif xxxobj == 'PersonObject':
                                msginfo = personObject.get(k)
                            elif xxxobj == 'MotorVehicleObject':
                                msginfo = motorVehicleObject.get(k)
                            elif xxxobj == 'NonMotorVehicleObject':
                                msginfo = nonMotorVehicleObject.get(k)
                            if msginfo:
                                if k != 'SubImageList':
                                    objmsg += '    {} {}:{}\n'.format(msginfo,k,v)
                                else:
                                    objmsg += '    {} {}:{}字节\n'.format(msginfo,k,len(str(v)))
                                    xx = x.get('SubImageList').get('SubImageInfoObject')
                                    if isinstance(xx, list):
                                        if len(xx) == 0:
                                            objmsg += '      SubImageList->SubImageInfoObject -> {}\n'.format(xx) 
                                        else:
                                            for y in xx:
                                                #print(y.keys())
                                                objmsg += '    图片\n'
                                                for k,v in y.items():
                                                    if k != 'Data':
                                                        objmsg += '      SubImageList->SubImageInfoObject -> {}:{}\n'.format(k,v)   
                                                    else:
                                                        objmsg += '      SubImageList->SubImageInfoObject -> {}:{}字节\n'.format(k, len(str(v)))   
                            else:
                                objmsg += '    未定义 {}:{}\n'.format(k,v)
        
    return objmsg
    
def get_face(jsondata):
    msg = ''
    if jsondata:
        listobj = jsondata.get('FaceListObject')
        if listobj:  
            msg += parse_objs(listobj, 'FaceListObject')
    return msg
        
def get_person(jsondata):
    msg = ''
    if jsondata:
        listobj = jsondata.get('PersonListObject')
        if listobj:  
            msg += parse_objs(listobj, 'PersonListObject')
    return msg
    
def get_MotorVehicle(jsondata):
    msg = ''
    if jsondata:
        listobj = jsondata.get('MotorVehicleListObject')
        if listobj:  
            msg += parse_objs(listobj, 'MotorVehicleListObject')
    return msg
    
def get_NonMotorVehicle(jsondata):
    msg = ''
    if jsondata:
        listobj = jsondata.get('NonMotorVehicleListObject')
        if listobj:  
            msg += parse_objs(listobj, 'NonMotorVehicleListObject')
    return msg
    
def get_file(jsondata):
    msg = ''
    if jsondata:
        listobj = jsondata.get('FileListObject')
        if listobj:            
            filelist = listobj.get('File')
            if isinstance(filelist, list):
                msg += '文件 FileListObject->File\n'
                if len(filelist) == 0:
                    msg += '[]\n'
                else:
                    for x in filelist:
                        # 1
                        msg += '  文件信息:\n'
                        if x.get("Data") is not None:
                            msg += '  Data:{}字节\n'.format(len(x.get("Data")))
                        if isinstance(x.get('FileInfo'),dict):
                            msg += '  FileInfo\n'
                            for k,v in x.get('FileInfo').items():
                                msg += '    {} {}:{}\n'.format(fileInfo.get(k),k,v)
                        # 2
                        msg += parse_objs(x.get('PersonList'), 'PersonList')
                        msg += parse_objs(x.get('FaceList'), 'FaceList')
                        msg += parse_objs(x.get('MotorVehicleList'), 'MotorVehicleList')
                        msg += parse_objs(x.get('NonMotorVehicleList'), 'NonMotorVehicleList')
    return msg    
      
def get_image(jsondata):
    msg = ''
    if jsondata:
        listobj = jsondata.get('ImageListObject')
        if listobj:
            imagelist = listobj.get('Image')
            if isinstance(imagelist, list):                
                msg += '图像 ImageListObject->Image\n'
                if len(imagelist) == 0:
                    msg += '[]\n'
                else:
                    for x in imagelist:
                        # 1
                        msg += '  图像信息:\n'
                        if x.get("Data") is not None:
                            msg += '  Data:{}字节\n'.format(len(x.get("Data")))
                        if isinstance(x.get('ImageInfo'),dict):
                            msg += '  ImageInfo\n'
                            for k,v in x.get('ImageInfo').items():
                                msg += '    {} {}:{}\n'.format(imageInfo.get(k),k,v)
                        # 2
                        msg += parse_objs(x.get('PersonList'), 'PersonList')
                        msg += parse_objs(x.get('FaceList'), 'FaceList')
                        msg += parse_objs(x.get('MotorVehicleList'), 'MotorVehicleList')
                        msg += parse_objs(x.get('NonMotorVehicleList'), 'NonMotorVehicleList')
    return msg
      
def get_video(jsondata):
    msg = ''
    if jsondata:
        listobj = jsondata.get('VideoSliceListObject')
        if listobj:
            videolist = listobj.get('VideoSlice')
            if isinstance(videolist, list):
                msg += '视频片段 VideoSliceListObject->VideoSlice\n'
                if len(videolist) == 0:
                    msg += '[]\n'
                else:
                    for x in videolist:
                        # 1
                        msg += '  视频信息:\n'
                        if x.get("Data") is not None:
                            msg += '  Data:{}字节\n'.format(len(x.get("Data")))
                        if isinstance(x.get('VideoSliceInfo'),dict):
                            msg += '  VideoSliceInfo\n'
                            for k,v in x.get('VideoSliceInfo').items():
                                msg += '    {} {}:{}\n'.format(videoSliceInfo.get(k),k,v)
                        # 2
                        msg += parse_objs(x.get('PersonList'), 'PersonList')
                        msg += parse_objs(x.get('FaceList'), 'FaceList')
                        msg += parse_objs(x.get('MotorVehicleList'), 'MotorVehicleList')
                        msg += parse_objs(x.get('NonMotorVehicleList'), 'NonMotorVehicleList')
    return msg
    
def readfile(file):
    # face
    print('-'*10,file)
    with open(file, 'r', encoding='utf8') as f:
        jsondata = json.loads(f.read())
    return jsondata
    
if __name__ == '__main__':    
    import time
    print("""
    1, 输入json的文件名，直接回城使用默认的文件
    """)
    u_select = input("输入文件地址：")
    a= time.time()
    if u_select == '':
        print('使用demo')
        file1 = "K:/Server/src/界面5.9/client_data/"+'faces.json'
        print(get_face(readfile(file1)))    
        file1 = "K:/Server/src/界面5.9/client_data/"+'persons.json'
        print(get_person(readfile(file1)))
        file1 = "K:/Server/src/界面5.9/client_data/"+'motorvehicle.json'
        print(get_MotorVehicle(readfile(file1)))
        file1 = "K:/Server/src/界面5.9/client_data/"+'nonmotor.json'
        print(get_NonMotorVehicle(readfile(file1)))
        file1 = "K:/Server/src/界面5.9/client_data/"+'files.json'
        print(get_file(readfile(file1)))
        file1 = "K:/Server/src/界面5.9/client_data/"+'images.json'
        print(get_image(readfile(file1)))
        file1 = "K:/Server/src/界面5.9/client_data/"+'videos.json'
        print(get_video(readfile(file1)))
    else:
        file1 = u_select
        print(get_face(readfile(file1)))    
        print(get_person(readfile(file1)))
        print(get_MotorVehicle(readfile(file1)))
        print(get_NonMotorVehicle(readfile(file1)))
        print(get_file(readfile(file1)))
        print(get_image(readfile(file1)))
        print(get_video(readfile(file1)))  
    print(time.time()-a, 's')
